home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / make-367.lha / make-3.67 / variable.h < prev    next >
C/C++ Source or Header  |  1992-12-22  |  4KB  |  100 lines

  1. /* Copyright (C) 1988, 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
  2. This file is part of GNU Make.
  3.  
  4. GNU Make is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2, or (at your option)
  7. any later version.
  8.  
  9. GNU Make is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. GNU General Public License for more details.
  13.  
  14. You should have received a copy of the GNU General Public License
  15. along with GNU Make; see the file COPYING.  If not, write to
  16. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  17.  
  18. /* Codes in a variable definition saying where the definition came from.
  19.    Increasing numeric values signify less-overridable definitions.  */
  20. enum variable_origin
  21.   {
  22.     o_default,        /* Variable from the default set.  */
  23.     o_env,        /* Variable from environment.  */
  24.     o_file,        /* Variable given in a makefile.  */
  25.     o_env_override,    /* Variable from environment, if -e.  */
  26.     o_command,        /* Variable given by user.  */
  27.     o_override,     /* Variable from an `override' directive.  */
  28.     o_automatic,    /* Automatic variable -- cannot be set.  */
  29.     o_invalid        /* Core dump time.  */
  30.   };
  31.  
  32. /* Structure that represents one variable definition.
  33.    Each bucket of the hash table is a chain of these,
  34.    chained through `next'.  */
  35.  
  36. struct variable
  37.   {
  38.     struct variable *next;    /* Link in the chain.  */
  39.     char *name;            /* Variable name.  */
  40.     char *value;        /* Variable value.  */
  41.     enum variable_origin
  42.       origin ENUM_BITFIELD (3);    /* Variable origin.  */
  43.     unsigned int recursive:1;    /* Gets recursively re-evaluated.  */
  44.     unsigned int expanding:1;    /* Nonzero if currently being expanded.  */
  45.     enum
  46.       {
  47.     v_export,        /* Export this variable.  */
  48.     v_noexport,        /* Don't export this variable.  */
  49.     v_ifset,        /* Export it if it has a non-default value.  */
  50.     v_default        /* Decide in target_environment.  */
  51.       } export ENUM_BITFIELD (2);
  52.   };
  53.  
  54. /* Structure that represents a variable set.  */
  55.  
  56. struct variable_set
  57.   {
  58.     struct variable **table;    /* Hash table of variables.  */
  59.     unsigned int buckets;    /* Number of hash buckets in `table'.  */
  60.   };
  61.  
  62. /* Structure that represents a list of variable sets.  */
  63.  
  64. struct variable_set_list
  65.   {
  66.     struct variable_set_list *next;    /* Link in the chain.  */
  67.     struct variable_set *set;        /* Variable set.  */
  68.   };
  69.  
  70. extern struct variable_set_list *current_variable_set_list;
  71.  
  72.  
  73. extern void push_new_variable_scope (), pop_variable_scope ();
  74.  
  75. extern int handle_function ();
  76.  
  77. extern char *variable_buffer_output ();
  78. extern char *variable_expand (), *variable_expand_for_file ();
  79. extern char *allocated_variable_expand_for_file ();
  80. #define    allocated_variable_expand(line) \
  81.   allocated_variable_expand_for_file (line, (struct file *) 0)
  82. extern char *expand_argument ();
  83.  
  84. extern void define_automatic_variables ();
  85. extern void initialize_file_variables ();
  86. extern void print_file_variables ();
  87.  
  88. extern void merge_variable_set_lists ();
  89.  
  90. extern struct variable *try_variable_definition ();
  91.  
  92. extern struct variable *lookup_variable (), *define_variable ();
  93. extern struct variable *define_variable_for_file ();
  94.  
  95. extern int pattern_matches ();
  96. extern char *subst_expand (), *patsubst_expand (), *recursively_expand ();
  97.  
  98. extern char **target_environment ();
  99. extern int export_all_variables;
  100.